﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<DataAccessLayer.Booking>>" %>
 
<table width="100%">
        <tr>
           
            <th>
                ID
            </th>
            <th>
                BookingNumber
            </th>
           
            <th>
                BookingStatus
            </th>
           
            <th>
                Number of Room
            </th>

            <th>
                Guest Name
            </th>

            <th>
                Total Price
            </th>
            
            <th>
                Start Date
            </th>
            <th>
                End Date
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
               <a href="../check/<%: item.ID %>"><%: item.ID %></a>
            </td>
            <td>
                <%: item.BookingNumber %>
            </td>
             
            <td>
                <%: item.BookingStatus %>
            </td>

            <td>
                <%: item.Guest != null ? item.Guest.FirstName + " " + item.Guest.LastName : string.Empty %>
            </td>
           
            <td>
                <%: item.NoOfRoom %>
            </td>

            <td>
                <%: item.TotalPrice %>
            </td>
             
            <td>
                <%: String.Format("{0:g}", item.StartDate.Value.ToString("dd/MM/yyyy")) %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.EndDate.Value.ToString("dd/MM/yyyy")) %>
            </td>
        </tr>
    
    <% } %>

    </table>



